#ifndef GRAPHPOINTERGUARD_H_
#define GRAPHPOINTERGUARD_H_

#include "graph_support/Graph.h"

namespace native_orbitor
{

/**
 * Graph type independent guard
 */
// TODO: this class is not needed, Graph has virtual destructor
class GraphPointerGuard
{
public:
	GraphPointerGuard( GRAPH_SUPPORT_NS::Graph * abstractGraphPtr, void ( * deleteGraphFunc ) ( GRAPH_SUPPORT_NS::Graph * ) );
	~GraphPointerGuard();

public:
	GRAPH_SUPPORT_NS::Graph * getAbstractGraphPtr();

private:
	GRAPH_SUPPORT_NS::Graph * abstractGraphPtr;
	void ( * deleteGraphFunc ) ( GRAPH_SUPPORT_NS::Graph * );
};

}

#endif /* GRAPHPOINTERGUARD_H_ */
